<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf8">
            <script language="javascript">
                var ctuapp_share_img = "www.baidu.com";
                
                //扫一扫
                function scanClick() {
                window.webkit.messageHandlers.ScanAction.postMessage(null);
                }
            
                function getQRCode(result) {
                    asyncAlert(result);
                    document.getElementById("returnValue").value = result;
                }
            
            
            
                //获取定位
                function locationClick() {
                    //  window.webkit.messageHandlers.Location.postMessage(null);
                    window.webkit.messageHandlers.Location.postMessage("你是哪位？？"); //里面是传的参数
                }
            
                function setLocation(location) {
                    asyncAlert(location);
                    document.getElementById("returnValue").value = location;
                }
            
            
              //修改背景颜色
                function colorClick() {
                    window.webkit.messageHandlers.Color.postMessage([203,55,62,1.0]);
                }
        
        
              //分享操作
                function shareClick() {
                    window.webkit.messageHandlers.Share.postMessage({title:'测试分享的标题',content:'测试分享的内容',url:'http://m.rblcmall.com/share/openShare.htm?share_uuid=shdfxdfdsfsdfs&share_url=http://m.rblcmall.com/store_index_32787.htm&imagePath=http://c.hiphotos.baidu.com/image/pic/item/f3d3572c11dfa9ec78e256df60d0f703908fc12e.jpg'});
                }
            
            
                function shareResult(channel_id,share_channel,share_url) {
                    var content = channel_id+","+share_channel+","+share_url;
                   // asyncAlert(content);
                    document.getElementById("returnValue").value = content;
                }
            
            
             //支付操作
                function payClick() {
                    window.webkit.messageHandlers.Pay.postMessage({order_no:'201511120981234',channel:'wx',amount:1,subject:'粉色外套'});
                }
            
                function payResult(str) {
                    asyncAlert(str);
                    document.getElementById("returnValue").value = str;
                }
            
            //摇一摇
            function shake() {
                window.webkit.messageHandlers.Shake.postMessage(null);
            }
            
            //返回
            function goBack() {
                window.webkit.messageHandlers.GoBack.postMessage(null);
            }
            
           //播放声音
            function playSound() {
            window.webkit.messageHandlers.PlaySound.postMessage('shake_sound_male.wav');
            }
        
        
         //警告框
            function asyncAlert(content) {
                setTimeout(function(){
                           alert(content);
                           },1);
            }
            
            
                </script>
            
    </head>
    
    <body>
        <h1>这是按钮调用</h1>
        <input type="button" value="扫一扫" onclick="scanClick()" />
        <input type="button" value="获取定位" onclick="locationClick()" />
        <input type="button" value="修改背景色" onclick="colorClick()" />
        <input type="button" value="分享" onclick="shareClick()" />
        <input type="button" value="支付" onclick="payClick()" />
        <input type="button" value="摇一摇" onclick="shake()" />
        <input type="button" value="返回" onclick="goBack()" />
        <input type="button" value="播放声音" onclick="playSound()" />
        
        <h1>这是文件上传</h1>
        
        <input type="file" />
        
        <h1>这是回调结果展示区</h1>
        <textarea id ="returnValue" type="value" rows="5" cols="40">
            
        </textarea>
        
        <h4>竖直方向的表头：</h4>
        <table border="1" style="width:90%;height:600px">
            <tr>
                <th>姓名</th>
                <td>Bill Gates</td>
            </tr>
            <tr>
                <th>电话</th>
                <td>555 77 854</td>
            </tr>
            <tr>
                <th>传真</th>
                <td>555 77 855</td>
            </tr>
        </table>
        
        
    </body>
</html>

